<template>
  <div v-if="!isUserFrame">
    <router-view />
  </div>
   <div v-else>
     <el-container>
      <el-header><Header/></el-header>
      <el-container>
        <el-aside width="auto"><Menu /></el-aside>
        
        <el-main>
          <router-view />
        </el-main>
      </el-container>
    </el-container>
   </div>
</template>

<script setup lang="ts">
import Header from "./components/Header.vue";
import Menu from "./components/Menu.vue";

const route = useRoute();
const router = useRouter();
const isUserFrame =ref(false)


onMounted( async () =>{

  await router.isReady()
  isUserFrame.value = route.meta.isUserFrame == false ? false : true
  //console.log(route.meta.isUserFrame)

  watch(route ,() =>{
    isUserFrame.value = route.meta.isUserFrame == false ? false : true
  })
})
</script>

<style scoped>
body {
  margin: 0;
  padding: 0;
}
.el-header { 
  background-color: chartreuse;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.el-aside {
  background-color: aqua; height: calc(100vh);
  }
</style>
